//
//  CarBrandModel.m
//  DingDongXiChe
//
//  Created by wtjr on 2018/1/11.
//  Copyright © 2018年 xieyingze. All rights reserved.
//

#import "CarBrandModel.h"

@implementation CarBrandModel

- (instancetype)initWithDic:(NSDictionary *)dictionary {
    self = [super init];
    if (self) {
        self.brandName = dictionary[@"name"];
        self.icon = dictionary[@"icon"];
        self.isShow = NO;
        for (NSDictionary *dic in dictionary[@"type"]) {
            NSArray *temp = dic[@"cars"];
            for (NSString *name in temp) {
                CardModel *model = [CardModel new];
                model.name = name;
                [self.cars addObject:model];
            }
        }
    }
    return self;
}

- (NSMutableArray *)cars {
    if (!_cars) {
        _cars = [NSMutableArray array];
    }
    return _cars;
}

@end
